class Solution {
public:
    string largestNumber(vector<int>& nums) {
        vector<string> str;
        for(auto& s:nums)
            str.push_back(to_string(s));
        sort(str.begin(),str.end(),[](const string& s1,const string&s2){
            return s1+s2>s2+s1;
        });
        string tmp;
        for(auto& s:str)
            tmp+=s;
        if(tmp[0]=='0')
            return "0";
        else
            return tmp;
    }
};
